package com.shell.arouter.demo.multitype;

import android.widget.TextView;

import androidx.annotation.NonNull;

import com.durian.base.frame.activity.ActivityFrame;
import com.durian.base.utils.LogUtils;
import com.durian.base.utils.ToastUtils;
import com.durian.base.utils.ToolUtils;
import com.durian.ui.adapter.multi.ItemViewProvider;
import com.durian.ui.adapter.multi.MultiItemViewHolder;
import com.durian.ui.adapter.multi.OnItemClickListener;
import com.henanjianye.soon.communityo2o2.R;

/**
 * 说明：OneC
 * <p/>
 * 作者：fanly
 * <p/>
 * 类型：Class
 * <p/>
 * 时间：2019-11-12 16:49
 * <p/>
 * 版本：version 1.0
 */
public class OneC extends ItemViewProvider<OneC.C> {

    public OneC(){
        setOnItemClickListener(new OnItemClickListener<C>() {
            @Override
            public void onItemClick(int position, C item) {
                ToastUtils.get().shortToast("C---" + item.name);
            }
        });
    }

    @Override
    protected void convert(@NonNull MultiItemViewHolder holder, @NonNull C item, int position) {
        TextView tv = holder.getView(R.id.tv_name_c);
        tv.setText("C---" + item.name);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        LogUtils.e("fanly", "OneC destroy()");
    }

    @Override
    protected int getItemLayoutId() {
        return R.layout.item_mul_one_c;
    }

    public static class C {
        public String name;

        public C(String name) {
            this.name = name;
        }
    }

}
